<?php
	
	function enviar_mail($to,$subject,$message,$from){
	   			$headers = "From: ".$from."\r\n"; 
			
			// Now we specify our MIME version
			
			    $headers .= "MIME-Version: 1.0\r\n"; 
			
			// Create a boundary so we know where to look for
			// the start of the data
			
			    $boundary = uniqid("HTMLEMAIL"); 
			    
			// First we be nice and send a non-html version of our email
			    
			    $headers .= "Content-Type: multipart/alternative;".
			                "boundary = $boundary\r\n\r\n"; 
			
			    $headers .= "This is a MIME encoded message.\r\n\r\n"; 
			
			    $headers .= "--$boundary\r\n".
			                "Content-Type: text/plain; charset=ISO-8859-1\r\n".
			                "Content-Transfer-Encoding: base64\r\n\r\n"; 
			                
			    $headers .= chunk_split(base64_encode(strip_tags($message))); 
			
			// Now we attach the HTML version
			
			    $headers .= "--$boundary\r\n".
			                "Content-Type: text/html; charset=ISO-8859-1\r\n".
			                "Content-Transfer-Encoding: base64\r\n\r\n"; 
			    $headers .= chunk_split(base64_encode($message));
			if (mail($to, $subject, '', $headers)){
				return true;
			}else{
				return false;
			}
			
		}	
?>